﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"   ValidateRequest="false"  CodeBehind="GoodsManage.aspx.cs" Inherits="XinBang.Web.Admin.GoodsManage" Title="无标题页" %>
<asp:Content ID="Content1" ContentPlaceHolderID="headerplace" runat="server">
<script type="text/javascript" src="../js/lib/tinymce/tiny_mce.js"></script>
<script type="text/javascript">
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "advanced",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,inlinepopups",

		// Theme options
		theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example word content CSS (should be your site CSS) this one removes paragraph margins
		content_css : "css/word.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainplace" runat="server">
<h2><asp:Literal ID="ttitle" runat="server" Text="文章管理"></asp:Literal></h2>
<asp:MultiView ID="MultiView1" runat="server">
    <asp:View ID="View1" runat="server">
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CssClass="show" DataSourceID="ObjectDataSource2" PageSize="20" DataKeyNames="Gooid">
            <Columns>
                <asp:BoundField DataField="Gooid" HeaderText="编号" SortExpression="Gooid" >
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="标题" SortExpression="Title">
                    <ItemTemplate>
                        <asp:HyperLink ID="edittitle" runat="server" NavigateUrl='<%# Bind("Gooid","GoodsManage.aspx?action=edit&artid={0}") %>' Text='<%# Bind("GoodsName") %>'>数据绑定</asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Price" HeaderText="商品价格" ReadOnly="True" SortExpression="Price" />
                <asp:BoundField DataField="Pubtime" HeaderText="发布日期" ReadOnly="True" SortExpression="Pubtime" />
                <asp:TemplateField HeaderText="图片管理" SortExpression="Title">
                    <ItemTemplate>
                        <asp:HyperLink ID="edittitle1" runat="server" NavigateUrl='<%# Bind("Gooid","AttachementManage.aspx?action=default&gooid={0}") %>'>图片管理</asp:HyperLink>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="库存管理" SortExpression="Title">
                    <ItemTemplate>
                        <asp:HyperLink ID="edittitle2" runat="server" NavigateUrl='<%# Bind("Gooid","StoreManage.aspx?action=default&gooid={0}") %>'>库存管理</asp:HyperLink>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="营销策略" SortExpression="Title">
                    <ItemTemplate>
                        <asp:HyperLink ID="edittitle3" runat="server" NavigateUrl='<%# Bind("Gooid","SaleStrategyManage.aspx?action=default&gooid={0}") %>'>营销策略</asp:HyperLink>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:CommandField ShowDeleteButton="True" HeaderText="删除" >
                    <ItemStyle HorizontalAlign="Center" />
                </asp:CommandField>
            </Columns>
            <AlternatingRowStyle CssClass="alt" />
            <PagerStyle CssClass="pager" />
            <PagerSettings FirstPageText="首页" LastPageText="末页" Mode="NextPreviousFirstLast"
                    NextPageText="下一页" PreviousPageText="上一页" />
            <EmptyDataTemplate>
                没有数据,<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="GoodsManage.aspx?action=add">添加数据</asp:HyperLink>!
            </EmptyDataTemplate>
        </asp:GridView>
    </asp:View>
    <asp:View ID="View3" runat="server">
        <asp:Repeater ID="Repeater1" runat="server" DataSourceID="ObjectDataSource1">
        <HeaderTemplate>
            <ul>
        </HeaderTemplate>
        <FooterTemplate>
            </ul>
        </FooterTemplate>
        <ItemTemplate>
            <li><asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# Eval("Catid","GoodsManage.aspx?action=list&catid={0}") %>' Text='<%# Eval("CatalogName","{0}") %>'>绑定数据</asp:HyperLink></li>
        </ItemTemplate>
        </asp:Repeater>
    </asp:View>
    <asp:View ID="View4" runat="server">
        <table class="show">
            <tr><td>
                <asp:HiddenField ID="Gooid" runat="server" />
            分类:<asp:DropDownList ID="catlogDropdownlist" runat="server" DataSourceID="ObjectDataSource1" DataTextField="CatalogName" DataValueField="Catid">
				    </asp:DropDownList><br />
			名称:<asp:TextBox ID="GoodsNameBox" runat="server" Columns="40"></asp:TextBox><br />
			价格:<asp:TextBox ID="PriceBox" runat="server"></asp:TextBox><br />
			介绍:<asp:TextBox  ID="ContentBox" runat="server" Columns="90" MaxLength="8000" Rows="15" TextMode="MultiLine"></asp:TextBox><br />
			<asp:LinkButton ID="Save" runat="server" OnClick="Save_Click">保存</asp:LinkButton> 
                <asp:LinkButton ID="Reset" runat="server" CausesValidation="False" CommandName="Cancel">重置</asp:LinkButton></td></tr>
	    </table>
    </asp:View>
</asp:MultiView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetAllCatalogs"
        TypeName="XinBang.BLL.GoodsCatalogBL" DataObjectTypeName="XinBang.Entity.GoodsCatalog"></asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" TypeName="XinBang.BLL.GoodsBL"
  SelectMethod="GetAllGoodsByCatid" 
  DeleteMethod="DeleteGoods" OnDeleted="DeletedGoods" OnDeleting="DeleteingGoods" DataObjectTypeName="XinBang.Entity.Goods" >
    <SelectParameters>
        <asp:QueryStringParameter DefaultValue="0" Name="catid" QueryStringField="catid"
            Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
</asp:Content>
